﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>登录</title>
    <link rel="stylesheet" href="~/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="~/css/login.css" />
</head>
<body class="beg-login-bg layui-container">
    <div class="beg-login-box">
        <header>
            <h1>用户登录</h1>
        </header>
            <div class="beg-login-main">
                <form class="layui-form" method="post">
                    <div class="layui-form-item">
                        <label class="beg-login-icon">
                            <i class="layui-icon">&#xe678;</i>
                        </label>
                        <input type="text" name="mobilePhone" lay-verify="mobilePhone" autocomplete="off" value="" placeholder="请输入您的用户名" class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <label class="beg-login-icon">
                            <i class="layui-icon">&#xe642;</i>
                        </label>
                        <input type="password" name="userPwd" lay-verify="userPwd" autocomplete="off" value="" placeholder="请输入您的登陆密码" class="layui-input">
                    </div>
                    <div class="layui-form-item layui-row login-btn-group">
                        <div class="layui-col-xs12">
                            <button class="layui-btn layui-btn-warm layui-btn-fluid" lay-submit lay-filter="login">
                                 登录
                            </button>
                        </div>
                    </div>
                </form>
            </div>
            @*<footer>
            <p>Beginner © www.zhengjinfan.cn</p>
            </footer>*@
        </div>
        <script type="text/javascript" src="~/plugins/layui/layui.js"></script>
        <script>

        layui.config({
            base: '/js/' //你存放新模块的目录，注意，不是layui的模块目录
        });

        layui.use(['layer', 'form','common'], function () {
            var layer = layui.layer,
                $ = layui.jquery,
                form = layui.form,
                common = layui.common;

            form.on('submit(login)', function (data) {

                $.post("@Url.Action("index","login")", data.field).done(function (response) {
                    if (response.isSuccessed) {
                        window.location.href = "/Admin/Home/Index";
                    } else {
                        common.msgError(response.errorMessage.Message);
                    }
                });
                //location.href='index.html';
                return false;
            });
        });</script>
</body>
</html>